package com.hlhj.carview.module

import android.content.Context
import com.example.mymvp.log
import com.example.mymvp.mvp.BaseModule
import com.hlhj.carview.Iview.MainView
import com.hlhj.carview.bean.WeatherBean
import com.hlhj.carview.http.Apis
import com.hlhj.carview.http.CustomAction
import com.hlhj.carview.http.LoadingAction
import com.lzy.okgo.OkGo
import com.lzy.okgo.model.Response

/**
 * Created by Never Fear   on 2018\12\20 0020.
Never More....
 */
class MainModule :BaseModule {
    var lis:MainView?=null

    fun getWeather(c:Context,city:String){
        log("fhp","到底来没来tianqi？")
        /*Apis.getWeather(city)
                ?.let {
                    it.doOnSubscribe(LoadingAction(c))
                            .subscribe(object :CustomAction<Response<WeatherBean>>(c){
                                override fun httpSuccess(t: Response<WeatherBean>) {
                                    lis?.setWeather(t.body())
                                }
                            })
                }*/
    }
    fun w(c:Context,city:String){
        log("fhp","到底来没来tianqi？")
        /*Apis.getWeather(city)
                ?.let {
                    it.doOnSubscribe(LoadingAction(c))
                            .subscribe(object :CustomAction<Response<WeatherBean>>(c){
                                override fun httpSuccess(t: Response<WeatherBean>) {
                                    lis?.setWeather(t.body())
                                }
                            })
                }*/
    }
}